<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="html" indent="yes"   />
	<xsl:template match="/">
		<xsl:if test="string-length(Schema/@MasterPageFile)&gt;0">
		  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>%@ Page language="c#" MasterPageFile="<xsl:value-of select="Schema/@MasterPageFile"></xsl:value-of>" Title="<xsl:value-of select="Schema/@TableName" />列表" CodeFile="<xsl:value-of select="Schema/@TableName" />List.aspx.cs" AutoEventWireup="true" Inherits="<xsl:value-of select="Schema/@TableName" />List" %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
		</xsl:if>
		<xsl:if test="string-length(Schema/@MasterPageFile)&lt;=0">
		  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>%@ Page language="c#"  CodeFile="<xsl:value-of select="Schema/@TableName" />List.aspx.cs" AutoEventWireup="true" Inherits="<xsl:value-of select="Schema/@TableName" />List" %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
		</xsl:if>
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>%@ Register Src="~/UC/NumericPager.ascx" TagName="NumericPager" TagPrefix="uc" %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>%@ Register Src="~/UC/PagerControl.ascx" TagName="PagerControl" TagPrefix="uc" %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>%@ Register TagPrefix="uc" TagName="SelectLanguage" Src="~/UC/SelectLanguage.ascx"  %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    <xsl:if test="string-length(Schema/@MasterPageFile)&gt;0">
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Content ID="ctHeader" ContentPlaceHolderID="ContentPlaceHolderHeader" runat="server"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:Content<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
		<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Content ID="ctToolbar" ContentPlaceHolderID="ContentPlaceHolderToolbar" runat="Server"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Panel ID="panelCurrentPath" Height="20px" CssClass="divPagePath"
         runat="server"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
        当前位置：<xsl:value-of select="Schema/@TableName" />管理 -> <xsl:value-of select="Schema/@TableName" />管理
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:Panel<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
      <div class="divLangSelect">
        <xsl:text disable-output-escaping="yes">&lt;</xsl:text>uc:SelectLanguage ID="LanguageSelect" runat="server" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
      </div>
		<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:Content<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
		<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Content ID="ctList" ContentPlaceHolderID="ContentPlaceHolderList" runat="Server"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    </xsl:if>
    <xsl:if test="string-length(Schema/@MasterPageFile)&lt;=0">
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>html xmlns="http://www.w3.org/1999/xhtml"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
        <xsl:text disable-output-escaping="yes">&lt;</xsl:text>head runat="server"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
          <xsl:text disable-output-escaping="yes">&lt;</xsl:text>meta http-equiv="Content-Type" content="text/html; charset=utf-8" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
          <xsl:text disable-output-escaping="yes">&lt;</xsl:text>title>untitle<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/title<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
          <xsl:text disable-output-escaping="yes">&lt;</xsl:text>link href="/css/style.css" rel="stylesheet" type="text/css" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
        <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/head<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
        <xsl:text disable-output-escaping="yes">&lt;</xsl:text>body<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
        <xsl:text disable-output-escaping="yes">&lt;</xsl:text>form id="frmMain" method="post" runat="server"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    </xsl:if>
            <table width="100%" class="tableContent" cellspacing="1">
              <tr>
                  <td colspan="6" class="tdHeader">
                      <img src="/Images/search1.gif" />
                      请填写查询条件
                  </td>
              </tr>
              <tr>
                <td class="tdTitle">
                  关键字：
                </td>
                <td>
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:TextBox ID="txtKeyword" runat="server" Width="102px" MaxLength="50" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                </td>
                <td class="tdTitle">
                </td>
                <td>
                </td>
                <td class="tdTitle">
                </td>
                <td>
                </td>
              </tr>
              <tr>
                <td colspan="6" align="right" class="tdButton">
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Button runat="server" ID="btnSearch" Text="搜索" OnClick="btnSearch_Click" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Button runat="server" ID="btnView" Text="查看" OnClick="btnView_Click" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Button runat="server" ID="btnInsert" Text="增加" OnClick="btnInsert_Click" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Button runat="server" ID="btnUpdate" Text="修改" OnClick="btnUpdate_Click" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Button runat="server" ID="btnDelete" Text="删除" OnClick="btnDelete_Click" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                </td>
              </tr>
              <tr>
                <td colspan="6">
                  <xsl:text disable-output-escaping="yes">&amp;</xsl:text>nbsp;
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Label ID="lblMessage" runat="server" ForeColor="Red" EnableViewState="False" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                </td>
              </tr>
            </table>
            <br />
            <table width="100%" class="tableSubtitle" cellspacing="1">
                <tr>
                    <td align="left">
                        <img src="/Images/icon_note.gif" alt="" />
                        列表
                    </td>
                </tr>
            </table>
             <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:GridView ID="gvResult" runat="server" DataKeyNames=<xsl:for-each select="Schema/Columns[IsPK='1']"> "<xsl:value-of select="ColumnName" />"</xsl:for-each>
    OnSorting="gvResult_Sorting"  AllowSorting="true" OnRowCommand="gvResult_RowCommand" Style="position: static; width: 100%; height: 20px"
    AutoGenerateColumns="False" <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
              <Columns>
                <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:TemplateField HeaderText="选择" Visible="false" <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                  <ItemStyle HorizontalAlign="Center" Wrap="False" Width="6%" />
                  <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                  <HeaderTemplate>
                    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:CheckBox ID="cbxSelect" runat="server" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                  </HeaderTemplate>
                  <ItemTemplate>
                    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:CheckBox ID="cbxSelect" runat="server" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                  </ItemTemplate>
                <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:TemplateField<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
				  <xsl:for-each select="Schema/Columns[IsIdentity='false']">
                <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:BoundField DataField="<xsl:value-of select="ColumnName"></xsl:value-of>" SortExpression="<xsl:value-of select="ColumnName"></xsl:value-of>" HeaderText="<xsl:value-of select="Description"></xsl:value-of>" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
				  </xsl:for-each>
                <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:TemplateField<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                  <ItemTemplate>
                    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:HyperLink ID="btnView" runat="server" NavigateUrl='<xsl:text disable-output-escaping="yes">&lt;</xsl:text>%# "<xsl:value-of select="Schema/@TableName" />View.aspx?q=" + GetEncryptQueryString("<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>=" + DataBinder.Eval(Container.DataItem,"<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>")) %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>'<xsl:text disable-output-escaping="yes">&gt;</xsl:text>查看
                    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:HyperLink<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:HyperLink ID="btnEdit" runat="server" NavigateUrl='<xsl:text disable-output-escaping="yes">&lt;</xsl:text>%# "<xsl:value-of select="Schema/@TableName" />Edit.aspx?q=" + GetEncryptQueryString("Action=edit<xsl:text disable-output-escaping="yes">&amp;</xsl:text><xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>=" + DataBinder.Eval(Container.DataItem,"<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>")) %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>'<xsl:text disable-output-escaping="yes">&gt;</xsl:text>编辑
                    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:HyperLink<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                        <xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:LinkButton ID="btnDelete" runat="server" CommandArgument='<xsl:text disable-output-escaping="yes">&lt;</xsl:text>%# DataBinder.Eval(Container.DataItem,"<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>") %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>'
							CommandName="Del"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>删除<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:LinkButton<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                    
                  </ItemTemplate>
                <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:TemplateField<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
              </Columns>
    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:GridView<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
            <table width="100%" border="0" class="tablePager">
              <tr>
                <td style="width: 50%" align="left">
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>uc:PagerControl ID="gridPager" runat="server" PagerControlNames="numPager" PageSize="20" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                </td>
                <td style="width: 50%" align="right">
                  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>uc:NumericPager ID="numPager" runat="server" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
                </td>
              </tr>
            </table>
    <xsl:if test="string-length(Schema/@MasterPageFile)&gt;0">
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:Content<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    </xsl:if>
    <xsl:if test="string-length(Schema/@MasterPageFile)&lt;=0">
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/form<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/body<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>/html<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    </xsl:if>   
        </xsl:template>
</xsl:stylesheet>